package io.gitee.duxiuhuan.mailbox.utils;

import java.util.Random;

public class IdUtils {
    public static long generateId() {
        long timestamp = System.currentTimeMillis();  // 获取当前时间戳
        Random random = new Random();
        int randomInt = random.nextInt(1000);  // 生成一个 0-999 范围内的随机整数
        return timestamp * 1000 + randomInt;  // 时间戳 + 随机数
    }
}
